package com.ls.mianshi;


import java.util.concurrent.CopyOnWriteArrayList;

public class FailSafe {
    public static void main(String[] args) {
        CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();
        list.add("A");
        list.add("B");
        list.add("C");

        for (String s : list) {
            if ("C".equals(s)){
                list.add("D");
            }
            System.out.println(s);
        }
    }
}
